import django_filters

from .models import UserAddress
from django.db.models import Q


class UserAddressFilter(django_filters.rest_framework.FilterSet):
    '''
    商品过滤的类
    '''
    signer_name = django_filters.CharFilter(
        field_name="signer_name", lookup_expr='contains', help_text='签收人')
    address = django_filters.CharFilter(
        field_name="address", lookup_expr='contains', help_text='签收地址')
    signer_mobile = django_filters.CharFilter(
        field_name="signer_mobile", lookup_expr='contains', help_text='签收人电话')

    class Meta:
        model = UserAddress
        fields = ['signer_name', 'address', 'signer_mobile']
